<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
    <meta name="keywords" content="确认订单" />
    <meta name="description" content="确认订单" />
    <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width,viewport-fit=cover">
    <link th:href="@{/shoppingApi/css/public.css}" rel="stylesheet">
    <link th:href="@{/shoppingApi/css/order.css}" rel="stylesheet">
    <link th:href="@{/shoppingApi/css/weui.min.css}" rel="stylesheet">
    <link th:href="@{/shoppingApi/css/jquery-weui.min.css}" rel="stylesheet">
</head>
<body>
<div class="main myorder">
    <div class="main_con c323232">
        <!--<p class="order_title pl15 pr15 bgfff ft17 c323232 ftc flex flex-ac">-->
        <!--<img class="back" src="./images/back.png">-->
        <!--<span class="it1">确认订单</span>-->
        <!--</p>-->
        <!--地址-->
        <div class="bgfff">
            <div class="address pt25 pb25 pl15 pr15 flex arrow" onclick="showaddress();" th:data="${orderSure.isMoreAddress}" id="">
                <img class="mt5" id="myaddresslist" th:src="@{/shoppingApi/images/ordercity.png}">
                <div id="address" th:if="${orderSure.address!=null}" th:data="${orderSure.address.id}" class="ft17 c323232 ml10 it1 pr20">
                    <!--<div id="address" th:if="${orderSure.address==null}" data="0" class="ft17 c323232 ml10 it1 pr20">-->
                    <p>
                        <span th:if="${orderSure.address!=null}" th:text="${orderSure.address.name}"> </span>
                        <span th:if="${orderSure.address!=null}" class="ml25" th:text="${orderSure.address.phone}"></span>
                    </p>
                    <p class="ft14 mt10">
                        <label>地址：</label>
                        <label th:if="${orderSure.address!=null}" th:text="${orderSure.address.provinceName+orderSure.address.cityName+orderSure.address.areaName+orderSure.address.detailAddr}"></label>
                    </p>
                </div>
                <div id="address" th:if="${orderSure.address==null}" data="0" class="ft17 c969696 ml10 it1 pr20">
                    <p>添加地址</p>
                </div>
            </div>
            <img class="w100 db" th:src="@{/shoppingApi/images/line.png}">
        </div>
        <input type="hidden" id="isMoreAddress" th:data="${orderSure.isMoreAddress}">
        <input type="hidden" id="addressCount" th:data="${orderSure.addressCount}">
        <div class="mt15">
            <p class="shop flex flex-ac pl15 bgfff">
                <img th:src="@{/shoppingApi/images/carttip.png}" >
                <span class="ml15 ft17 c323232">新零售微店</span>
            </p>
        </div>
        <div class="mb15">
            <div class="mb15 bgfff goodcon" goodid="6">
                <div class="pl15 pr15 pt10 flex  product-info" th:each="model:${orderSure.productInfo}">
                    <a class="db pic ml15 mb10">
                        <img class="w100" th:src="${'http://xlspic.ycsqd.com'+model.imgUrl}">
                    </a>
                    <div class="it1 ml15">
                        <p class="ft17 c323232 mt5" th:text="${model.productName}"></p>
                        <p class="ft14 c323232 mt5" th:text="${model.productDesc}"></p>
                        <p class="cf70029 mt10 ft17">
                            <span>￥</span><i class="product-price"  th:text="${model.productPrice}"></i>
                            <span class="c323232 fr" >×<i class="product-count" th:text="${model.productCount}"></i></span>
                        </p>
                    </div>
                </div>
            </div>
            <div class="mt15 pl15 pr15 shopmoney ft15 c323232 heigth45 bgfff flex flex-pj">
                <span>商品金额</span>
                <span>￥<span class="product-total-price" th:text="${#numbers.formatDecimal(orderSure.proPrice,1,2)}">0.00</span></span>
            </div>
            <div class="mt15 quan bgfff">
                <div class="pl15 pr15 ft17 c646464 overflow rela">
                    <div class="quans flex flex-pj flex-ac">
                        <p class="it1">
                            <span class="db" th:text="${'可用'+orderSure.WebConfig.finacename2}"></span><!--兑换券-->
                            <span class="ft12 c969696" th:text="${'(您当前共有￥'+orderSure.avgCoupon+orderSure.WebConfig.finacename2+')'}"></span>
                        </p>

<!--<span class="fr ft14 mr10" data="1" th:title="${'-￥'+#numbers.formatDecimal(orderSure.couponAll, 1, 2)+orderSure.WebConfig.finacename2}" th:id="'spcoupon'+${orderSure.count}" th:if="${orderSure.couponAll<orderSure.avgCoupons}" th:text="${'-￥'+#numbers.formatDecimal(orderSure.couponAll, 1, 2)+orderSure.WebConfig.finacename2}"th:coupon="${#numbers.formatDecimal(orderSure.couponAll, 1, 2)}"></span>-->
<!--<span class="fr ft14 mr10" data="1" th:title="${'-￥'+orderSure.avgCoupon+orderSure.WebConfig.finacename2}" th:id="'spcoupon'+${orderSure.count}"  th:if="${orderSure.couponAll>orderSure.avgCoupons}" th:text="${'-￥'+orderSure.avgCoupon+orderSure.WebConfig.finacename2}"th:coupon="${#numbers.formatDecimal(orderSure.avgCoupons, 1, 2)}"></span>-->

                        <span class="fr ft14 mr10" data="1" th:title="${'-￥'+#numbers.formatDecimal(orderSure.couponAll, 1, 2)+orderSure.WebConfig.finacename2}" th:id="'spcoupon'+${orderSure.count}" th:if="${orderSure.couponAll<orderSure.avgCoupons}" th:text="${'-￥'+#numbers.formatDecimal(orderSure.couponAll, 1, 2)+orderSure.WebConfig.finacename2}" th:coupon="${#numbers.formatDecimal(orderSure.couponAll, 1, 2)}"></span>
                        <span class="fr ft14 mr10" data="1" th:title="${'-￥'+#numbers.formatDecimal(orderSure.avgCoupons, 1, 2)+orderSure.WebConfig.finacename2}" th:id="'spcoupon'+${orderSure.count}" th:if="${orderSure.couponAll>=orderSure.avgCoupons}" th:text="${'-￥'+#numbers.formatDecimal(orderSure.avgCoupons, 1, 2)+orderSure.WebConfig.finacename2}" th:coupon="${#numbers.formatDecimal(orderSure.avgCoupons, 1, 2)}"></span>
                        <!--<span class="fr ft14 mr10" data="1" th:title="${'-￥0.00'+orderSure.WebConfig.finacename2}" th:id="'spcoupon'+${orderSure.count}" th:if="${orderSure.avgCoupons==0}" th:text="${'-￥0.00'+orderSure.WebConfig.finacename2}" th:coupon="${'0.00'}"></span>-->
                    </div>
                    <!--券信息弹窗-->
                    <div class="quan_alert c323232" style="display: none">
                        <div class="quan_con bgfff">
                            <p class="ft17 c323232 ftc mb10" th:text="${orderSure.WebConfig.finacename2}"></p>
                            <p class="ft15 c323232 pb25 ftc">
                                该订单最多可使用
                                <span class="bold" th:text="${'￥'+orderSure.couponAll}"></span>
                                <i th:text="${orderSure.WebConfig.finacename2}"></i>
                            </p>
                            <div class="flex flex-pj flex-ac mb15">
                                <div>
                                    <p class="db">
                                        <span class="ft17 c000"><i th:text="${'使用'+orderSure.WebConfig.finacename2}"></i></span><span class="ft10 cf70029">(抵扣)</span>
                                    </p>
                                    <p class="ft10 c000 mt5" th:text="${'(您当前共有￥'+orderSure.avgCoupon+orderSure.WebConfig.finacename2+')'}"></p>
                                </div>
                                <div>
                                    <span class="ft17 cf70029 mr10" th:if="${orderSure.avgCoupons>orderSure.couponAll}" th:text="${'-￥'+#numbers.formatDecimal(orderSure.couponAll, 1, 2)+orderSure.WebConfig.finacename2}"></span>
                                    <span class="ft17 cf70029 mr10" th:if="${orderSure.avgCoupons<orderSure.couponAll}" th:text="${'-￥'+(orderSure.avgCoupon)+orderSure.WebConfig.finacename2}"></span>
                                    <input type="checkbox" th:info="${orderSure.WebConfig.finacename2}" th:data="${orderSure.count}"  th:id="${orderSure.count}" th:value="${orderSure.WebConfig.finacename2}" onclick="CheckD(this,1);" checked="checked" name="let">
                                </div>
                            </div>
                            <p class="ft17 cfff close ftc bgf70029">关闭</p>
                        </div>
                    </div>
                </div>
                <div class="pl15 pr15 ft17 c646464 overflow rela ">
                    <div class="quans flex flex-pj flex-ac">
                        <p class="it1">
                            <span class="db"  th:text="${'可用'+orderSure.WebConfig.finacename3}"></span>
                            <span class="ft12 c969696" th:text="${'(您当前共有￥'+orderSure.avgCashCoupon+orderSure.WebConfig.finacename3+')'}"></span>
                        </p>
                        <span class="fr ft14 mr10" data="1" th:title="${'-￥'+#numbers.formatDecimal(orderSure.realCashCouponAll, 1, 2)+orderSure.WebConfig.finacename3}"  th:id="'spcashcoupon'+${orderSure.count}"  th:if="${orderSure.avgCashCoupons>=orderSure.realCashCouponAll}" th:text="${'-￥'+#numbers.formatDecimal(orderSure.realCashCouponAll, 1, 2)+orderSure.WebConfig.finacename3}" th:cashcoupon="${#numbers.formatDecimal(orderSure.realCashCouponAll, 1, 2)}"></span>
                        <span class="fr ft14 mr10" data="1" th:title="${'-￥'+(orderSure.avgCashCoupon)+orderSure.WebConfig.finacename3}" th:id="'spcashcoupon'+${orderSure.count}"  th:if="${orderSure.avgCashCoupons<orderSure.realCashCouponAll}" th:text="${'-￥'+(orderSure.avgCashCoupon)+orderSure.WebConfig.finacename3}" th:cashcoupon="${#numbers.formatDecimal(orderSure.avgCashCoupon, 1, 2)}"></span>
                        <!--<span class="fr ft14 mr10" data="1" th:title="${'-￥0.00'+orderSure.WebConfig.finacename3}" th:id="'spcashcoupon'+${orderSure.count}"  th:if="${orderSure.avgCashCoupons==0}" th:text="${'-￥0.00'+orderSure.WebConfig.finacename3}" th:cashcoupon="${0.00}"></span>-->
                    </div>
                    <!--券信息弹窗-->
                    <div class="quan_alert c323232" style="display: none">
                        <div class="quan_con bgfff">
                            <!--<p class="ft17 c323232 ftc mb10" th:text="${orderSure.WebConfig.finacename3}"></p>-->
                            <!--<p class="ft15 pl25 mb10">当前等级<span class="bold" th:text="${'（'+orderSure.WebConfig.finacename3+'）'}"></span></p>-->
                            <!--<p class="ft15 pl25 mb10">该订单最多可用-->
                                <!--<span class="bold" th:text="${'￥'+orderSure.realCashCouponAll}"></span>-->
                                <!--<i th:text="${orderSure.WebConfig.finacename3}"></i>-->
                            <!--</p>-->
                            <!--<div class="flex flex-pj flex-ac">-->
                                <!--<div>-->
                                    <!--<p>-->
                                        <!--<span class="ft17 c000" th:text="${'使用'+orderSure.WebConfig.finacename3}"></span>-->
                                        <!--<span class="ft10 cf70029">(抵扣)</span>-->
                                    <!--</p>-->
                                    <!--<p class="ft10 c000 mt5" th:text="${'(您当前共有￥'+orderSure.avgCashCoupon+orderSure.WebConfig.finacename3+')'}"></p>-->
                                <!--</div>-->
                                <!--<div>-->
                                    <!--<span class="ft17 cf70029 mr10" th:if="${orderSure.avgCashCoupons>orderSure.realCashCouponAll}" th:text="${'-￥'+orderSure.realCashCouponAll+orderSure.WebConfig.finacename3}"></span>-->
                                    <!--<span class="ft17 cf70029 mr10" th:if="${orderSure.avgCashCoupons<orderSure.realCashCouponAll}" th:text="${'-￥'+(orderSure.avgCashCoupon)+orderSure.WebConfig.finacename3}"></span>-->
                                    <!--<input type="checkbox" th:info="${orderSure.WebConfig.finacename3}"  th:id="${orderSure.count}" th:data="${orderSure.count}" onclick="CheckD(this,2);"  checked="checked" name="let">-->
                                <!--</div>-->
                            <!--</div>-->
                            <!--<div class="ft14 c969696 ftc bgf0f0f0">-->
                                <!--<p class="pb15 heigth45  ftl bgfff pl15 pr15">用户等级使用<i th:text="${orderSure.WebConfig.finacename3}"></i>抵扣该订单说明：</p>-->
                                <!--<p class="pad15 overflow">-->
                                    <!--<span class="fl">游客</span>-->
                                    <!--<span class="fr">￥10</span></p>-->
                                <!--<p class="pb15 c323232 overflow pl15 pr15">-->
                                    <!--<span class="fl">会员</span>-->
                                    <!--<span class="fr">￥30</span></p>-->
                                <!--<p class="pb15 overflow pl15 pr15">-->
                                    <!--<span class="fl">店主</span>-->
                                    <!--<span class="fr">￥40</span></p>-->
                                <!--<p class="pb15 overflow pl15 pr15">-->
                                    <!--<span class="fl">优质店主</span>-->
                                    <!--<span class="fr">￥55</span></p>-->
                            <!--</div>-->
                            <!--<p class="ft17 cfff close ftc bgf70029">关闭</p>-->
                        </div>
                    </div>
                </div>
                <div class="pl15 pr15 ft17 c646464 overflow rela">
                    <div class="quans flex flex-pj flex-ac">
                        <p class="it1">
                            <span class="db">会员节省</span>
                        </p>
                        <span class="fr ft14 mr10" th:text="${'-￥'+#numbers.formatDecimal(orderSure.memberSave, 1, 2)}"></span>
                    </div>
                </div>
            </div>
        </div>

        <p class="heigth45 mt15 pl15 pr15 bgfff overflow ft17 c323232">
            <span class="fl">配送费</span>
            <span class="fr ft14" th:if="${orderSure.freight!=null}" th:text="${'+￥'+#numbers.formatDecimal(orderSure.freight, 1, 2)}"></span>
        </p>
        <div>
            <!--<p class="heigth45 mt15 pl15 pr15 bgfff overflow ft17 c323232 flex mess">-->
                <!--<span>买家留言：</span>-->
                <!--<span class="it1">-->
                <!--<input class="w100" type="text" placeholder="选填 建议留言前先与商家沟通协定">-->
            <!--</span>-->
            <!--</p>-->
            <p class="total c323232 bgfff ftr pr15">
                <span class="ft17 mr15">
                                        共
                    <span class="totalnum vab" th:text="${#numbers.formatDecimal(orderSure.productNumber, 0, 0)}">0</span>
                    件
                </span>
                <span class="ft14 ml15">小计
                    <span class="cf70029">￥</span>
                    <span class="cf70029 mr15 money" th:text="${#numbers.formatDecimal((orderSure.realPay+orderSure.freight), 1, 2)}"></span>
                </span>
            </p>
        </div>
        <div class="fixedBox50">
            <div class="fixed-bottom flex flex-col flex-pe">
                <div class="mt15 othermess">
                     <p class="heigth45 ftc ft17 cfff bgff99aa"  th:if="${orderSure.WebConfig.cashcouponmul!=0}" th:text="${'该单可返￥'+(#numbers.formatDecimal((orderSure.realPay*2), 1, 2))+orderSure.WebConfig.finacename3}"></p>
                     <p class="pl15 pr15 ftl ft14 ccb3724 bgf8d598 pt5 pb5 bottom_address hide"  th:if="${orderSure.address!=null}"  th:text="${'送至'+orderSure.address.provinceName+orderSure.address.cityName+orderSure.address.areaName+orderSure.address.detailAddr}"></p>
                </div>
                <div class="flex flex-pj flex-ac bgfff put">
            <span class="it1 c323232 ft17">
                <span class="ml15" th:text="${'共'+orderSure.productNumber+'件，总金额'}"></span>
                <span class="cf70029">￥</span>
                <span class="ft20 cf70029" th:text="${#numbers.formatDecimal((orderSure.realPay+orderSure.freight), 1, 2)}"></span>
            </span>
                    <span class="putin ftc" th:backCashCoupon="${orderSure.backCashCoupon}" th:memberSave="${orderSure.memberSave}"  th:freight="${orderSure.freight}" th:realPay="${#numbers.formatDecimal((orderSure.realPay), 1, 2)}" th:data="${orderSure.cartIds}" th:count="${orderSure.count}">提交订单</span>
                </div>
            </div>
        </div>
    </div>
</div>
<!--快速导航-->
<div class="mini-mask"></div>
<div class="mini-btn"></div>
<div class="mini-nav">
    <ul>
        <li><a href="/">
            <h5>首页</h5>
        </a></li>
        <li><a href="/wap/selectProductYJAndRjClassfy">
            <h5>分类</h5>
        </a></li>
        <li><a href="javascript:sharebtn()">
            <h5>分享</h5>
        </a></li>
        <li><a href="/wap/openUserCenter">
            <h5>个人中心</h5>
        </a></li>
        <li><a href="javascript:alert('敬请期待...')">
            <h5>店铺</h5>
        </a></li>
        <li><a href="/wap/getCartList">
            <h5>购物车</h5>
        </a></li>
        <li><a href="javascript:alert('敬请期待...')">
            <h5>联系客服</h5>
        </a></li>
    </ul>
</div>
<div id="mini-popup" class="weui-popup__container popup-bottom">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal share-layer">
        <p class="flex mt20 mb20 flex-ac pl15 pr15">
            <span class="ml20 mr20 it1 lineh1"></span>
            <span class="ft14 c323232">分享到</span>
            <span class="ml20 mr20 it1 lineh1"></span>
        </p>
        <ul class="overflow ft14 c323232 ftc">
            <li id="miniShareMessage">
                <img class="wxhaoyou" th:src="@{/shoppingApi/images/share1.png}">
                <p class="mt10 ">微信好友</p>
            </li>
            <li id="miniShareTimeline">
                <img th:src="@{/shoppingApi/images/share2.png}">
                <p class="mt10">朋友圈</p>
            </li>
        </ul>
        <img class="close close-popup" th:src="@{/shoppingApi/images/close3.png}">
    </div>
</div>
<!--/快速导航-->
</body>
<script th:src="@{/shoppingApi/js/jquery-3.3.1.min.js}"></script>
<script th:src="@{/shoppingApi/js/common.js}"></script>
<script th:src="@{/shoppingApi/js/jquery-weui.min.js}"></script>
<script type="text/javascript" th:src="@{/shoppingApi/js/plusShare.js}"></script>
<script th:src="@{/shoppingApi/js/mininav.js}"></script>
<script type="text/javascript">

function showaddress() {
    // window.location.href="/wap/myAddress";
    var redirection = encodeURIComponent(location.href);
    location.href = '/wap/myAddress?updateAddressURL='+redirection;
}
    function CheckD(obj,type) {
        var count=$(obj).attr('data');
        var info=$(obj).attr('info');
        var title1=$('#spcoupon'+count).attr('title');
        var title2=$('#spcashcoupon'+count).attr('title');
        if(type==1){
            if($(obj).is(":checked")){
                $('#spcoupon'+count).attr('data',1)
                $('#spcoupon'+count).html(title1);
            }
            else{
                $('#spcoupon'+count).attr('data',0)
                $('#spcoupon'+count).attr('checked',false);
                $('#spcoupon'+count).html("-￥0.00"+info);
            }
        }
        if(type==2){
            if($(obj).is(":checked")){
                $('#spcashcoupon'+count).attr('data',1)
                $('#spcashcoupon'+count).html(title2);
            }
            else{
                $('#spcashcoupon'+count).attr('data',0)
                $('#spcashcoupon'+count).attr('checked',false)
                $('#spcashcoupon'+count).html("-￥0.00"+info);
            }
        }
    }
    /*返回上一页*/
    $(".back").on('click',function () {
        window.history.back(-1);
    });
    // function myaddress1() {
    //     window.location="/wap/myAddress";
    // }
    /*提交订单*/
    $(".putin").on('click',function () {
        var ids=$.trim($(this).attr('data'));
        var realPay=$.trim($(this).attr('realPay'));
        var freight=$.trim($(this).attr('freight'));
        var addressId=$.trim($("#address").attr('data'));
        var memberSave=$.trim($(this).attr('memberSave'));
        var spcoupon=$.trim($('#spcoupon'+$(this).attr('count')).attr('data'));
        var spcashcoupon=$.trim($('#spcashcoupon'+$(this).attr('count')).attr('data'));
        var backCashCoupon=$.trim($(this).attr('backCashCoupon'));
        var coupon=0.00;
        var cashcoupon=0.00;
        if(spcoupon==1)
        {
            coupon=$.trim($('#spcoupon'+$(this).attr('count')).attr('coupon'));
        }
        if(spcashcoupon==1)
        {
            cashcoupon=$.trim($('#spcashcoupon'+$(this).attr('count')).attr('cashcoupon'));
        }
        if(addressId==0){
            $.toast('收货地址不能为空', 'text');
            return;
        }
        //alert(ids+"---"+addressId+"---"+coupon+"---"+cashcoupon+"---"+realPay+"---"+freight+"---"+memberSave);return;
        $.ajax({
            url: '/wap/addOrder',
            //type: 'post',
            data:{
                carts:ids,
                addressId:addressId,
                coupon:coupon,
                cashcoupon:cashcoupon,
                realPay:realPay,
                freight:freight,
                memberSave:memberSave,
                backCashCoupon:backCashCoupon
            },
            dataType: 'json',
            contentType: 'application/json',
            async: false,
            success: function(data){
                // if(data.msgCode="000000"){
                //     window.location.href="/wap/payOrder?No="+data.data;
                // }else if(data.data="-2"){
                //     $.toast("登录超时请重新登录!",1000, function() {
                //         window.location.href="/wap/openUserCenter";
                //     });
                // }else{
                //     alert("生成失败!");
                // }
                if(data.msgCode=="000000"){
                    window.location.href="/wap/payOrder?No="+data.data;
                }else if(data.data=="-2"){
                    $.toast("登录超时请重新登录!",1000, function() {
                        window.location.href="/wap/openUserCenter";
                    });
                }else if(data.data=="-1"){
                    $.toast("购物车数据有误,生成失败!",1000, function() {
                        //window.location.href="/wap/openUserCenter";
                    });
                }else if(data.data=="-3"){
                    $.toast("当前产品限购数量1次,生成失败!",1000, function() {
                        //window.location.href="/wap/openUserCenter";
                    });
                }else if(data.data=="-5"){
                    $.toast("当前产品不支持发往该地址,生成失败!",1000, function() {
                        //window.location.href="/wap/openUserCenter";
                    });
                }else
                {
                    $.toast("生成失败", 'cancel');
                }
            }
        });
    })
    /*修改数量*/
    /*$(".changenum .add").on('click',function () {
       var newval = Number($(this).parent().find(":input[type='number']").val()) +1;
        $(this).parent().find(":input[type='number']").val(newval)
        numtotal();
    })
    $(".changenum .count").on('click',function () {
        if(Number($(this).parent().find(":input[type='number']").val())>1){
            var newval = Number($(this).parent().find(":input[type='number']").val()) -1;
            $(this).parent().find(":input[type='number']").val(newval)
            numtotal();
        }
    })
    $(".myorder input[type='number']").change(function () {
        $(this).attr('num',$(this).val());
        numtotal();
    })
    numtotal();
    /!*计算数量及总价*!/
    function numtotal() {
        var totalprice =0.00;
        var checkgid=[];
        var total=0;
        $(".myorder .goodtype").each(function () {
            var goodid=$(this).parents(".goodcon").attr('goodid');
            checkgid.push(goodid);
            var parent = $(this).parents(".goodcon").find("input[type='number']").attr("price");
            var num = $(this).parents(".goodcon").find("input[type='number']").val();

            totalprice += Number(parent)* Number(num);
            total +=Number(num);
        })
        var totalprice = totalprice.toFixed(2)
        $(".money").text(totalprice);
        $(".totalnum").text(total);
    }*/

    /*下拉显示地址栏*/
    var startX =0;
    var startY =0;
    $(".myorder .main_con").on("touchstart", function (e) {
        startY = e.originalEvent.changedTouches[0].clientY;
    });
    $(".myorder .main_con").on("touchmove", function (e) {
        var moveY = e.originalEvent.changedTouches[0].clientY;
        if((moveY-startY)>0){
            if($(".myorder .fixed-bottom .bottom_address").hasClass("hide")){
                $(".myorder .fixed-bottom .bottom_address").removeClass("hide")
            }
        }
    });

    /*折扣券弹框显示隐藏*/
    // $(".myorder .quan div.arrow").on('click',function () {
    //     $(this).find(".quan_alert").fadeIn();
    // })
    // $(".myorder .quan_alert .quan_con .close").on('click',function () {
    //     $(this).parent().parent().fadeOut();
    //     return false;
    // })

    /*滑动到底部显示地址*/
    $(".main").scroll(function(){
        var $this =$(this),
            viewH =$(this).height(),//可见高度
            contentH =$(this).get(0).scrollHeight,//内容高度
            scrollTop =$(this).scrollTop();//滚动高度
        if(scrollTop/(contentH -viewH)>=0.99){ //到达底部100px时,加载新内容
            if($(".myorder .fixed-bottom .bottom_address").hasClass("hide")){
                $(".myorder .fixed-bottom .bottom_address").removeClass("hide")
            }
        }
    });


</script>
</html>